package com.github.bridge.client.esign.response;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
public class CreateAndStartResponse {
    @Schema(description = "签署流程id")
    private String signFlowId;
    @Schema(description = "第三方签署流程业务id")
    private String businessNo;
    @Schema(description = "流程状态：0-草稿，1-签署中，2-已完成，3-已过期，4-已拒签，5-已作废，6-作废中")
    private String signFlowStatus;
    @Schema(description = "文件信息")
    private List<SignFile> signFiles;
    @Schema(description = "附件信息集合")
    private List<Attachment> attachments;
    @Schema(description = "手动发起/结束配置项，仅当流程状态=草稿时返回manualConfig")
    private ManualConfig manualConfig;
    @Schema(description = "签署信息")
    private List<SignUrlInfo> signUrlInfos;
    @Data
    public static class SignFile {
        @Schema(description = "文件fileKey")
        private String fileKey;
        @Schema(description = "文档顺序,用于页面文档顺序显示")
        private Integer fileOrder;
        @Schema(description = "文件下载地址")
        private String downloadUrl;
        @Schema(description = "文件下载外网地址")
        private String downloadOuterUrl;
    }
    @Data
    public static class Attachment {
        @Schema(description = "附件fileKey")
        private String fileKey;
        @Schema(description = "附件顺序,用于页面文档顺序显示")
        private Integer fileOrder;
        @Schema(description = "文件下载地址")
        private String downloadUrl;
        @Schema(description = "文件下载外网地址")
        private String downloadOuterUrl;
    }
    @Data
    public static class ManualConfig {
        private SigningAreaPageInfo signingAreaPageInfos;
    }
    @Data
    public static class SigningAreaPageInfo {
        @Schema(description = "签署区设置页长链地址")
        private String signingAreaPageUrl;
        @Schema(description = "签署区设置页短链地址")
        private String signingAreaPageShortUrl;
    }

    @Data
    public static class SignUrlInfo {
        @Schema(description = "用户类型：1-内部，2-相对方")
        private Integer userType;
        @Schema(description = "签署方的名称")
        private String userName;
        @Schema(description = "用户编码（本系统的唯一标识）。")
        private String userCode;
        @Schema(description = "用户账号（客户系统的唯一标识）。")
        private String customAccountNo;
        @Schema(description = "用户默认组织编号/其他组织编号（本系统的唯一标识）。")
        private String departmentCode;
        @Schema(description = "用户默认组织账号（客户系统的唯一标识）。")
        private String customDepartmentNo;
        @Schema(description = "签署方企业名称（当签署主体为企业时展示）")
        private String organizationName;
        @Schema(description = "企业编码（本系统的唯一标识）。不为空时，签署主体视为企业。")
        private String organizationCode;
        @Schema(description = "企业账号（客户系统的唯一标识）。不为空时，签署主体视为企业。")
        private String customOrgNo;
        @Schema(description = "用户所在签署网络节点标识")
        private String estpNode;
        @Schema(description = "用户所在签署网络节点名称")
        private String estpNodeName;
        @Schema(description = "签署节点，最小为1。")
        private Integer signNode;
        @Schema(description = "节点内排序方式：0-顺序签，1-无序签，2-或签")
        private Integer signMode;
        @Schema(description = "节点内顺序")
        private Integer signOrder;
        @Schema(description = "可用印章介质：0-云印章及UKey印章、1-仅UKey印章、2-仅云印章。不传或传空时默认为2")
        private Integer UKeyOnly;
        @Schema(description = "签署链接地址")
        private String signUrl;
        @Schema(description = "签署链接地址（短链）")
        private String signUrlShort;
    }
}
